<template>
    <div>
<h1>商品展示页{{cate_id}}</h1>
<div v-for="i in goods_list" :key="i.id">
    <p>商品名：{{i.name}}</p>
    <p>商品价格：{{i.price}}</p>
    <p>图片：<img :src="base_url+i.img"></p>
    <p>分类：{{i.cate}}</p>
</div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            base_url:'http://127.0.0.1:8000/',
            goods_list:[],
            cate_id:this.$route.query.cate_id
        }
    },
    methods: {
        get_goods() {
            axios({
                url:this.base_url+'app01/showgoods/',
                params:{'cate_id':this.cate_id}
            }).then(resp=>{
                console.log(resp.data)
                this.goods_list=resp.data
            })
        }
    },
    created() {
        this.get_goods()
    }
}
</script>

<style scoped>

</style>
